package com.yeyks.consumer.service.impl;

import com.github.pagehelper.PageHelper;
import com.yeyks.common.base.PageResult;
import com.yeyks.common.param.PageParam;
import com.yeyks.common.param.activity.PushHandPlanStatParam;
import com.yeyks.common.result.activity.ActivityCardStatResult;
import com.yeyks.common.result.activity.PushHandPlanListResult;
import com.yeyks.consumer.dal.domain.UserMaker;
import com.yeyks.consumer.dal.dao.UserMakerMapper;
import com.yeyks.consumer.service.UserMakerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * <p>
 * 用户创客信息 服务实现类
 * </p>
 *
 * @author yun
 * @since 2020-03-04
 */
@Service
public class UserMakerServiceImpl extends ServiceImpl<UserMakerMapper, UserMaker> implements UserMakerService {

    /**
     * 邀请推手统计
     *
     * @param param
     * @return
     */
    @Override
    public List<ActivityCardStatResult> getPeopleStat(PushHandPlanStatParam param) {
        return baseMapper.getPeopleStat(param);
    }

    /**
     * 推手累计佣金
     *
     * @param param
     * @return
     */
    @Override
    public List<ActivityCardStatResult> getCommissionStat(PushHandPlanStatParam param) {
        return baseMapper.getCommissionStat(param);
    }

    /**
     * 推手列表
     *
     * @param param
     * @return
     */
    @Override
    public PageResult<PushHandPlanListResult> pushHandList(PageParam param) {
        PageHelper.startPage(param.getPageNum(), param.getPageSize());
        List<PushHandPlanListResult> lists = baseMapper.pushHandList();
        return PageResult.getPageResult(lists);
    }

    /**
     * 推手列表导出
     *
     * @return
     */
    @Override
    public List<PushHandPlanListResult> pushHandListDownload() {
        return baseMapper.pushHandList();
    }
}
